<?php

/**
 *
 */
class UserCenter{
	private static $instance = null;
	var $userList = array();
	var $roomList = array();
	function __construct()
	{

	}
	static function getInstance()
	{
		if(self::$instance==null)
		{
			self::$instance = new UserCenter();
		}
		return self::$instance;
	}
	function debug()
	{

	}

	function getUserList($roomID)
	{

	}

	function initRoom()
	{
		$rl = array("阳光牧场","阳光小镇","阳光王国");
		foreach($rl as $k=>$v)
		{
			$room = new Room();
			$room->roomID = $k;
			$room->roomName = $v;
			$this->roomList[$k]=$room;
		}
	}
	function getRoomList()
	{
		$temp = '{';
		//$tempa = "[";
		foreach($this->roomList as $k=>$v)
		{
			$temp .='"'.$k.'":'. $v.",";
			//$tempa .= "$k,";
		}
		$temp .='}';
		//$tempa .="]";
		$temp = str_replace(',}','}',$temp);
		//$tempa = str_replace(",]","]",$tempa);
		return $temp;//'{"room:"'.$temp.'",rooma":'.$tempa.'}';
	}

}//end of class UserCenter